<template>
  <div>
    <ul class="nav nav-tabs">
      <li>
        <router-link
          class="list-group-item"
          active-class="active"
          to="/home/news"
        >
          News
        </router-link>
      </li>
      <li>
        <router-link
          class="list-group-item"
          active-class="active"
          :to="{
            // 写成对象形式，需要使用命名路由的方法传递params参数
            name: 'Message',
            params: {
              id: 333,
            },
          }"
        >
          Message
        </router-link>
      </li>
    </ul>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: "HomeComp",
  methods: {
    mounted() {
      console.log(this.$route.query);
    },
  },
};
</script>

<style></style>
